package com.guang.springmybatistransaction;

import com.guang.springmybatistransaction.config.AppConfig;
import com.guang.springmybatistransaction.service.UserService;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author lg
 * @Description
 * @date 2022/9/8 16:25
 */
public class Test {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
        UserService userService = applicationContext.getBean(UserService.class);
        userService.doHandlTransaction();
        MapperScannerConfigurer bean = applicationContext.getBean(MapperScannerConfigurer.class);
        System.out.println(bean);
        bean = applicationContext.getBean(MapperScannerConfigurer.class);
        System.out.println(bean);
        bean = applicationContext.getBean(MapperScannerConfigurer.class);
        System.out.println(bean);
        bean = applicationContext.getBean(MapperScannerConfigurer.class);
        System.out.println(bean);
        bean = applicationContext.getBean(MapperScannerConfigurer.class);
        System.out.println(bean);
    }
}
